import React, { PureComponent } from 'react';
import { connect } from 'dva';
import Link from 'umi/link';
import router from 'umi/router';
import { Card, Row, Col, Divider } from 'antd';
import GridContent from '@/components/PageHeaderWrapper/GridContent';
import styles from './Center.less';

@connect(({ loading, user }) => ({
  //listLoading: loading.effects['list/fetch'],
  currentUser: user.currentUser,
}))
class Center extends PureComponent {
  state = {

  };

  componentDidMount() {
    const { dispatch } = this.props;

  }

  onTabChange = key => {
    router.push(`${match.url}/Bill`);
    // const { match } = this.props;
    // switch (key) {
    //   case 'Bill':
    //     router.push(`${match.url}/Bill`);
    //     break;
    //   case 'Receivable':
    //     router.push(`${match.url}/Receivable`);
    //     break;
    //   default:
    //     break;
    // }
  };



  render() {
    const {
      currentUser,
      match,
      location,
      children,
    } = this.props;

    const operationTabList = [
      {
        key: 'Bill',
        tab: (
          <span>
            运单 <span style={{ fontSize: 14 }}>(8)</span>
          </span>
        ),
      },
      {
        key: 'Receivable',
        tab: (
          <span>
            账单 <span style={{ fontSize: 14 }}>(8)</span>
          </span>
        ),
      },
    ];

    return (
      <Card
        className={styles.tabsCard}
        bordered={false}
        // tabList={operationTabList}
        // activeTabKey={location.pathname.replace(`${match.path}/`, '')}
        // onTabChange={this.onTabChange}
      >
        {children}
      </Card>

    );
  }
}

export default Center;
